<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>bookDetail</title>
    <link rel="stylesheet" th:href="@{/css/bookDetail.css}"/>
</head>
<body>
    <div class="wrapper">
        <div class="title">
            <h2 th:text="${bookDetail.book.name}">Spring boot+Maven入门.pdf</h2>
        </div>
        <div class="detail">
            <table>
                <tbody>
                    <tr>
                        <td>开发语言：<em th:each="label:${bookDetail.book.labelList}" th:if="${not #strings.isEmpty(label.tl) and label.tl.type=='语言'}" th:text="${label.tl.name}">Java</em></td>
                        <td>实例大小：<em th:text="${bookDetail.book.k}+'M'">1.67</em></td>
                    </tr>
                    <tr>
                        <td>下载次数：<em id="downloadCount" th:text="${bookDetail.downloads}">1</em></td>
                        <td>发布时间：<em th:text="${bookDetail.book.createtime}">2020-7-18</em></td>
                    </tr>
                    <tr>
                        <td>发布人：<em th:if="${not #strings.isEmpty(bookDetail.book.user)}" th:text="${bookDetail.book.user.nickname}">luozengliang</em></td>
                        <td>文件格式：<em th:if="${not #strings.isEmpty(bookDetail.book.type)}" th:text="${bookDetail.book.type}">未知</em><em th:unless="${not #strings.isEmpty(bookDetail.book.type)}" th:text="未知"></em></td>
                    </tr>
                    <tr>
                        <td>所需积分：<em th:text="${bookDetail.book.integral}">2</em></td>
                    </tr>
                    <tr>
                        <td>相关标签：<a class="relevant" href="" th:each="label:${bookDetail.book.labelList}" th:if="${not #strings.isEmpty(label.tl) and label.tl.type=='框架'}" th:text="${label.tl.name}">Spring</a></td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="see">
            <ul>
                <li>
                    <img th:src="@{/img/browse.png}"/>&nbsp;
                    <label th:text="${bookDetail.observations}">1289</label>
                </li>
                <li>
                    <a href="javascript:void(0)" class="likes">
                        <img th:if="${likeStatus=='no like'}" th:src="@{/img/good.png}"/>
                        <img th:unless="${likeStatus=='no like'}" th:src="@{/img/goodClick.png}"/>
                        <label id="likesCount" th:text="${bookDetail.likes}">111</label>
                    </a>
                </li>
                <li>
                    <a href="javascript:void(0)" class="collection">
                        <img th:if="${collectionStatus=='no collection'}" th:src="@{/img/favorite.png}"/>
                        <img th:unless="${collectionStatus=='no collection'}" th:src="@{/img/collectionClick.png}"/>
                        <label id="collectionsCount" th:text="${bookDetail.collections}">999</label>
                    </a>
                </li>
            </ul>
        </div>
        <div class="downloads">
            <h3><a class="download" th:href="'/download/file?fileName='+${bookDetail.book.href}"  href="javascript:void(0)"><img th:src="@{/img/downB.png}"/></a></h3>
        </div>
    </div>
</body>
<script th:src="@{https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/js/bookDetail.js}" id="referScript" th:data="${bookDetail.book.objectid}"></script>
<script src="/js/Dialog.js"></script>


<script th:inline="javascript">
    $(".downloads img").on("mouseenter",function(){
        $(this).attr("src",[[@{/img/downA.png}]]);
    });
    $(".downloads img").on("mouseleave",function(){
        $(this).attr("src",[[@{/img/downB.png}]]);
    });



</script>
</html>